package com.lyf.shop.dao;

import com.lyf.shop.entity.Item;
import com.lyf.shop.entity.Orders;
import com.lyf.shop.util.StrUtils;

import java.sql.SQLException;
import java.util.List;

public interface OrderDao {
    /**
     * 新增订单数据
     * @param orders
     * @return
     */
    int InsertOrder(Orders orders) throws SQLException;

    /**
     * 批量新增
     * @param items
     * @throws SQLException
     */
    void insertItem(List<Item> items) throws SQLException;

    /**
     *展示订单数据
     * @param uid
     * @return
     */
    List<Orders> GetOrderList(int uid) throws SQLException;

    /**
     * 使用oid查询item集合
     * @param oid
     * @return
     */
    List<Item> getItemByOid(String oid) throws SQLException;

    /**
     * 使用oid查询orders数据
     * @param oid
     * @return
     */
    Orders getOrderByOid(String oid) throws SQLException;

    /**
     * 支付成功
     * @param oid
     * @return
     */
    int updateOrderStateToPaySuccess(String oid) throws SQLException;

    List<Orders> getAllOrders(String uname, String ostate) throws SQLException;

    int updateOrderStateToSend(String oid,int state) throws SQLException;
}
